using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using XFFSM;
using XFGameFramework;

public class Fight_Resolution : FSMState
{
    private Module module;
    public PlayerModel player;
    public EnemyModel enemy;
    private FightUIController fightUIController => module.LoadController<FightUIController>();
    private PlayerController playerController => module.LoadController<PlayerController>();
    public override void OnEnter()
    {
        base.OnEnter();

        module = userData as Module;
        if (module == null) throw new System.Exception("userData is not Module");

        //获取玩家和敌人数据
        player = playerController.GetPlayerModel();
        enemy = module.GetModel<EnemyModel>();

        Debug.Log("Fight_Resolution OnEnter");
    }
 
    public override void OnExit()
    {
        base.OnExit();
        
        //fightUIController.UpdateAllText(player, enemy);
        fightUIController.UpdateHp(player.currentHp, enemy.currentHp);

        Debug.Log("Fight_Resolution OnExit");
    }

}
